import {WithId} from '@/store/modules/types/Bundle'

export interface FeeFormula extends WithId{
  name?: string | null
  description?:string | null
  criteria?:string | null
  formula?:string | null
  created_at?: Date
  updated_at?: Date
  deleted_at?: Date
}

export function emptyFeeFormula() : FeeFormula{
  return {
    name: null,
    description: "添加你的描述。。。",
    criteria: 'name = 资产名称 and duration > 10天 and duration < 2月 and category = 相机',
    formula: '({duration} / 100) * {price} * {discount} + 200 '
  }
}

export const FeeFormulaLang: { [key: string]: string } = {
  name: '名称',
  description: '描述',
  criteria: '匹配条件',
  formula: '计算公式',
  created_at: '创建日期'

}

export const FeeFormulaDataTableDef = {
  headers: [
    { text: '操作', value: 'action', sortable: false },
    {
      text: FeeFormulaLang['name'],
      value: 'name',

    },
    {
      text: FeeFormulaLang['formula'],
      value: 'formula',

    },
    {
      text: FeeFormulaLang['created_at'],
      value: 'created_at',
    }
  ]
}
